package com.mini.framework.communicate.mina.adapter;

import org.apache.mina.filter.codec.demux.MessageDecoderResult;

import com.mini.framework.communicate.mina.protocol.DecodeResult;

public class MsgDecoderResultAdapter {
	
	
	
	public static MessageDecoderResult getDecodeResult(DecodeResult result){
		if(result.equals(DecodeResult.OK)){
			return MessageDecoderResult.OK;
		}
		if(result.equals(DecodeResult.NEED_DATA)){
			return  MessageDecoderResult.NEED_DATA;
		}
		if(result.equals(DecodeResult.NOT_OK)){
			return MessageDecoderResult.NOT_OK;
		}
		throw new IllegalArgumentException("illegal decode result");
	}

}
